package com.tobe.spring_demo.program_transaction;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author yangqifan 2015年9月10日
 * 
 */
public class TransactionDemoTest {
	
	public static void main(String[] args) {
		//appcontext, spring容器上下文,解析xml配置创建bean容器, 
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-config-decarative-transaction.xml");
		//参数可以是类也可以是接口,返回结果有多个会抛出异常,比如传入接口  org.springframework.beans.factory.NoUniqueBeanDefinitionException
		
		UserService service = context.getBean(UserService.class);
		
		service.a();
		
		
	}

}

